package demo;

import com.taobao.api.ApiException;
import com.taobao.api.DefaultTaobaoClient;
import com.taobao.api.TaobaoClient;
import com.taobao.api.request.ItemcatsGetRequest;
import com.taobao.api.response.ItemcatsGetResponse;

public class Itemcats {

	public static void main(String[] args) {
		
		String appkey = "1021820838";
		String secret = "sandbox2a3b4dbc7f7139ac4d7304bdf";
		final String sessionKey = "6100514c989b9e3202e9af1e58de9777de922c64deeceff3638380614";
		String url = "http://gw.api.tbsandbox.com/router/rest";
		
		TaobaoClient client=new DefaultTaobaoClient(url, appkey, secret);
		ItemcatsGetRequest req=new ItemcatsGetRequest();
		req.setFields("cid,parent_cid,name,is_parent");
		req.setCids("50067207,");//电子凭证
		try {
			ItemcatsGetResponse response = client.execute(req);
			System.out.println(response.getBody());
		} catch (ApiException e) {
			e.printStackTrace();
		}
	}
}
